package com.supermap.dataservice.webservice;
import javax.xml.namespace.QName;

import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
/**
 * @author aqua
 * @description
 * @date 2020年04月20 12:06
 * @email 1301584033@qq.com
 */
public class Axis2Client {
    public static String zhishu(String dateDay){
        try{
            RPCServiceClient client = new RPCServiceClient();
            Options options = client.getOptions();
            String address = "http://183.230.183.20:8686/axis2/services/Meteorologicalservices?wsdl";
            EndpointReference epf = new EndpointReference(address);
            options.setTo(epf);
            QName qname = new QName("http://briup", "MeteoForecastDataGetDaily");
            //指定调用的方法和传递参数数据，及设置返回值的类型
            String   uName = "cqqxjkys";
            String 	 uPwd = "cqqxjkys@cqmb.121";
            String[]  sta ={ "MS"};
            String   date = dateDay;
            String[] elemental = {"*"};//获取数据字段数量参数,这样就是全部字段
            Object[] result = client.invokeBlocking(qname, new Object[] {uName,uPwd,sta,date,elemental}, new Class[] { String.class });
            return result[0].toString();
        }catch(Exception e){
            e.printStackTrace();
        }
        return null;
    }
}